import request from '../utils/request'

/**
 * 新增
 */
export function storeApply(params) {
  return request({
    url: '/api/mrApply',
    method: 'post',
    data: {...params}
  })
}
/**
 * 新增
 */
export function storeWeixiu(params, id) {
  return request({
    url: `/api/storeWeixiu/${id}`,
    method: 'post',
    data: {...params, id}
  })
}

/**
 * 修改现金收入
 */
export function updateApply(form, id) {
  return request({
    url: `/api/mrApply/${id}`,
    method: 'put',
    data: {...form, id}
  })
}

/**
 * 删除现金收入
 */
export function destroyApply(ids) {
  return request({
    url: '/api/mrApply',
    method: 'delete',
    data: {ids}
  })
}

/**
 * 现金列表
 */
export function applyList(params) {
  return request({
    url: '/api/applyList',
    method: 'post',
    data: {...params}
  })
}

/**
 * 获取申请单详细数据以修改
 */
export function editAppply(id) {
  return request({
    url: `/api/applyList/${id}`,
    method: 'get',
    data: {id}
  })
}

/**
 * 审核维修申请单
 * @returns {*}
 */
export function auditApply(params) {
  return request({
    url: '/api/mrApply/audit',
    method: 'post',
    data: {params}
  })
}
